/**
 * 
 */
package org.mspring.mlog.service;

import java.io.File;
import java.io.InputStream;

import org.mspring.mlog.service.exception.StorageException;

/**
 * 储存服务
 * 
 * @author Gao Youbo
 * @since 2012-9-7
 */
public interface StorageService {
    /**
     * 上传文件
     * 
     * @param filename
     * @param file
     * @return
     * @throws StorageException
     */
    public String put(String filename, File file) throws StorageException;

    /**
     * 上传
     * 
     * @param filename
     * @param is
     * @return
     * @throws StorageException
     */
    public String put(String filename, InputStream is) throws StorageException;

    /**
     * 删除
     * 
     * @param filename
     */
    public void remove(String filename);

    /**
     * 根据文件名称相对路径获取文件
     * 
     * @param filename
     * @return
     */
    public File get(String filename);

    /**
     * 获取文件访问的URL
     * 
     * @param filename
     * @return
     */
    public String getUrl(String filename);

}
